%%
%% This is file `beamerouterthemesjtubeamer.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamerouterthemesjtubeamer.dtx  (with options: `package')
%% ------------------------------------------------------------------------
%% Copyright (C) 2021-2023 SJTUG
%% 
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%% 
%%     http://www.apache.org/licenses/LICENSE-2.0
%% 
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%% ------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthemesjtubeamer}[2023/11/25 v3.0.1 sjtubeamer outer theme]
\RequirePackage{sjtuvi}
\DefineOption{outer}{nav}{miniframes}
\DefineOption{outer}{nav}{infolines}
\DefineOption{outer}{nav}{sidebar}
\DefineOption{outer}{nav}{default}
\DefineOption{outer}{nav}{smoothbars}
\DefineOption{outer}{nav}{split}
\DefineOption{outer}{nav}{shadow}
\DefineOption{outer}{nav}{tree}
\DefineOption{outer}{nav}{smoothtree}
\ExecuteOptionsBeamer{miniframes}
\DefineOption{outer}{logopos}{topright}
\DefineOption{outer}{logopos}{bottomright}
\ExecuteOptionsBeamer{bottomright}
\ProcessOptionsBeamer
\beamer@compresstrue
\if\EqualOption{outer}{logopos}{topright}
  \AtBeginDocument{
    \defbeamertemplate*{frametitle}{sjtubeamer}[1][]
    {%
      \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
      \@tempdima=\textwidth%
      \advance\@tempdima by\beamer@leftmargin%
      \advance\@tempdima by\beamer@rightmargin%
      \begin{beamercolorbox}[sep=0.15cm,leftskip=0.15cm,#1,wd=\the\@tempdima]{frametitle}
        \begingroup
        \usebeamerfont{frametitle}
        \vbox{}
        \ifx\insertframesubtitle\@empty\vskip-0.5ex%
        \else\vskip-0.7ex\fi%
        \if@tempswa\else\csname beamer@fte#1\endcsname\fi%
        \strut\insertframetitle\strut\par%
        {%
          \ifx\insertframesubtitle\@empty%
          \else%
          {
            \usebeamerfont{framesubtitle}
            \usebeamercolor[fg]{framesubtitle}
            \strut\insertframesubtitle\strut\par
          }%
          \fi
        }%
        \vskip-1.07ex%
        \endgroup%
        \raggedleft%
        \begingroup
        \ifx\insertframesubtitle\@empty\vskip-2.2ex%
        \else\vskip-3.05ex\fi%
        \resizebox{!}{3ex}{\vphantom{-}\usebeamertemplate{logo}}\hspace*{10pt}%
        \endgroup%
        \ifx\insertframesubtitle\@empty%
        \else\vskip0.75ex\fi%
        \if@tempswa\else\vskip-.3cm\fi%
      \end{beamercolorbox}%
    }
  }
  \if\EqualOption{outer}{nav}{default}
    \AtBeginDocument{
      \setbeamertemplate{frametitle}[sjtubeamer][leftskip=0cm,sep=0.3cm]
    }
  \fi
\fi
\if\EqualOption{outer}{nav}{miniframes}
  \useoutertheme[footline=institutetitle]{miniframes}
\else\if\EqualOption{outer}{nav}{sidebar}
    \useoutertheme{sidebar}
    \logo{\resizebox{!}{1cm}{\sjtubadge}}
    \def\sjtubeamer@outer@logopos{topright}
    \AtBeginDocument{
      \setbeamertemplate{frametitle}[sidebar theme]
    }
  \else
    \useoutertheme{\sjtubeamer@outer@nav}
    \setbeamercolor{title in head/foot}{use=structure,bg=white,fg=structure.fg}
  \fi\fi
\if\EqualOption{outer}{nav}{default}
  \setbeamercolor{frametitle}{use=palette primary,
    bg=palette primary.bg,fg=palette primary.fg}
\else\if\EqualOption{outer}{nav}{infolines}
  \setbeamercolor{author in head/foot}{use=structure,fg=white,bg=structure}
  \setbeamercolor{title in head/foot}{use=structure,fg=structure,bg=structure!10}
  \setbeamercolor{date in head/foot}{use=structure,fg=structure,bg=structure!20}
  \setbeamercolor{section in head/foot}{parent=author in head/foot}
  \setbeamercolor{subsection in head/foot}{parent=date in head/foot}
  \setbeamersize{text margin left=1cm,text margin right=1cm}
\else
  \setbeamercolor{frametitle}{use=titlelike,bg=white,fg=titlelike.fg}
  \setbeamercolor{frametitle right}{parent=subsection in head/foot}
\fi\fi
\setbeamertemplate{sidebar right}{}
\addtobeamertemplate{navigation symbols}{}{
  \hbox{
    \raisebox{1.2pt}[0pt][0pt]{
      \usebeamerfont{footline}
      \usebeamercolor{footline}
      \color{footline.fg!50}
      \insertframenumber/\inserttotalframenumber
      \hspace*{0.2em}
    }
  }
}
\if\EqualOption{outer}{logopos}{bottomright}
  \addtobeamertemplate{footline}{
    \hfill%
    \usebeamertemplate***{navigation symbols}%
    \llap{\raisebox{1pc}[0pt][0pt]{\insertlogo}}
    \hspace*{0.1cm}\par
    \vskip 4pt
  }{}
\else
  \addtobeamertemplate{footline}{
    \hfill%
    \usebeamertemplate***{navigation symbols}%
    \hspace*{0.1cm}\par
    \vskip 4pt
  }{}
\fi
\setbeamertemplate{page number in head/foot}{}
\endinput
%%
%% End of file `beamerouterthemesjtubeamer.sty'.
